package 力扣._2240_买钢笔和铅笔的方案数;

public class Solution {
    public long waysToBuyPensPencils(int total, int cost1, int cost2) {
        long sum = 0;
        for (int i = total / cost1; i >= 0; i--) {
            int now_money = total - i * cost1;
            sum += now_money / cost2 + 1;
        }
        return sum;
    }

    public static void main(String[] args) {
        long l = new Solution().waysToBuyPensPencils(1000000, 1, 1);
        System.out.println(l);
    }
}
